var i;
Object.defineProperty(exports, "__esModule", {
  value: true
});
var EventManager = require("AA_EventManager");
var ResKeeper = require("AA_ResKeeper");
var EvenType = require("AA_EvenType");
var _decorator = cc._decorator;
var _ccclass = _decorator.ccclass;
_decorator.property;

var _def_UI_CameraControl = function (e) {
  function _creator() {
    return null !== e && e.apply(this, arguments) || this;
  }
  __extends(_creator, e);
  _creator.prototype.onEnable = function () {
    EventManager.EventMgr.addEventListener(EvenType.EVENT_TYPE.Game_CameraControl, this.setCamera, this);
    EventManager.EventMgr.addEventListener("zuobiaozhuanhuan", this.zhuanHuanPost, this);
  };
  _creator.prototype.setCamera = function (e) {
    cc.winSize.height / cc.winSize.width <= 2 && (e -= .1);
    var t = 0;
    1 != e && (t = -50);
    var o = "cubicActionIn";
    1 != e && (o = "cubicActionOut");
    var n = this.node.getComponent(cc.Camera);
    cc.tween(this.node).to(.7, {
      y: t
    }, {
      easing: o
    }).start();
    cc.tween(n).to(.7, {
      zoomRatio: e
    }, {
      easing: o
    }).call(function () {
      EventManager.EventMgr.dispatchEvent(EvenType.EVENT_TYPE.Game_Hide);
      EventManager.EventMgr.dispatchEvent(EvenType.EVENT_TYPE.GAME_LOCK_SCREE, false);
    }).start();
  };
  _creator.prototype.zhuanHuanPost = function (e, t) {
    var o = this.node.getComponent(cc.Camera);
    var n = cc.v2();
    o.getScreenToWorldPoint(e, n);
    t(n);
  };
  _creator.prototype.onDisable = function () {
    EventManager.EventMgr.rmEventListener(EvenType.EVENT_TYPE.Game_CameraControl, this.setCamera, this);
  };
  return __decorate([_ccclass], _creator);
}(ResKeeper.default);
exports.default = _def_UI_CameraControl;